﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ReadyApps.Data.Exceptions
{
    /// <summary>
    /// Represents the error that occurs when a data store does not have a record
    /// of a page.
    /// </summary>
    public class PageNotFoundException : Exception
    {
        /// <summary>
        /// Initializes a new <see cref="PageNotFoundException"/> with the specified
        /// page ID.
        /// </summary>
        /// <param name="pageID">The page ID that was used to search for the page.</param>
        public PageNotFoundException(int pageID)
            : base(string.Format("Could not find a page with a page ID of '{0}'.", pageID)) { }

        /// <summary>
        /// Initializes a new <see cref="PageNotFoundException"/> for the specified
        /// page and revision number.
        /// </summary>
        /// <param name="pageID">The page ID that was used to search for the page.</param>
        /// <param name="revisionNumber">The specific revision number that was not
        /// found.</param>
        public PageNotFoundException(int pageID, int revisionNumber)
            : base(string.Format("Could not find revision number '{0}' for page ID '{1}'.",
                revisionNumber, pageID)) { }
    }
}
